<template>
	<view class="container">
		<view class="content" @click="openWorkDetails" v-for="(item,index) in list" :key="index">
			<image class="work-image" :src="item.thumb" mode="aspectFit"></image>
			<view class="content_list">
				<text>{{item.name}}</text>
			</view>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: []
			}
		},
		methods: {
			openWorkDetails() {
				uni.navigateTo({
					url: '/pages/work_details/index',
				});
			}
		},
		onLoad() {
			uni.request({
				url: 'https://baiyi.kent.work/api/v1/system/getConstructionList',
				method: 'post',
				data: {
					"page": 1,
					"limit": 10
				},
				success: res => {
					console.log(res);
					this.list = res.data.data.list
				}
			})
		}
	}
</script>

<style>
	.work-image {
		width: 100%;
		height: 406rpx;
		vertical-align: middle;
	}

	.content_list>text {
		display: flex;
		flex-direction: column;
		align-items: center;
		padding-top: 14rpx;
		font-size: 24rpx;
	}

	.content_list {
		width: 670rpx;
		height: 74rpx;
		background: #ffffff;
		border-radius: 0rpx 0rpx 12rpx 12rpx;
		margin-left: 40rpx;
	}

	.content {
		margin-top: 40rpx;
		margin-bottom: 20rpx;
	}
</style>